package com.zide.system.domain.user.vo.save;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zide.common.core.domain.entity.SysDept;
import com.zide.common.core.domain.entity.SysRole;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 石添
 * @date 2024/3/19 15:49
 */
@Schema(description = "入参 - 添加系统用户")
@Data
public class SystemUserSaveVO implements Serializable {

    private Long userId;

    private Long deptId;

    private String username;

    private String nickname;

    private String email;

    private String mobile;

    private String password;

    private String remark;

    private Integer sex;

    private String avatar;

    private Integer status;

    private String deptName;

    private String leader;

    private SysDept dept;

    private List<SysRole> roles;

    private Long[] roleIds;

    private Long[] postIds;

    private Long roleId;

    public boolean isAdmin() {
        return isAdmin(this.userId);
    }

    public static boolean isAdmin(Long userId) {
        return userId != null && 1L == userId;
    }
}
